/**
 * 
 */
package com.deep.test.event;

/**
 * @author hudepin
 *
 * 2018年2月2日下午12:52:03
 */
public class EventProducer {
	private ListenerRegister listenerRegister = new ListenerRegister();
	private int value;
	public int getValue() {
		return value;
	}
	public void setValue(int newValue) {
		if(newValue!=value){
			this.value = newValue;
			ValueChangeEvent event = new ValueChangeEvent(this,value);
			fireAEvent(event);
		}
		
	}
	public void fireAEvent(ValueChangeEvent event) {  
		listenerRegister.fireAEvent(event);  
    }  
	public void addListener(ValueChangeListener a) {  
		listenerRegister.addListener(a);  
    }  
  
    public void removeListener(ValueChangeListener a) {  
    	listenerRegister.removeListener(a);  
    }  

}
